package com.zs.blog.converter;

import com.zs.blog.model.dto.ArticleDTO;
import com.zs.blog.model.dto.ArticleTagDTO;
import com.zs.blog.model.entity.Article;
import com.zs.blog.model.vo.*;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Title: ArticleConverter
 * @Author zs
 * @Package com.zs.blog.converter
 * @Date 2024/12/16 22:04
 * @description: 文章相关的属性转换器
 */
@Mapper(componentModel = "spring")
public interface ArticleConverter {

    ArticleConverter  INSTANCE = Mappers.getMapper(ArticleConverter.class);

    List<ArticleListVO> completeArticle2ArticleListVO(List<Article> completeArticle);

    Article articleDTO2Article(ArticleDTO articleDTO);

    ArticleEditVO article2ArticleEditVO(Article article);

    List<ArticleRandomVO> articleList2ArticleRandomVOList(List<Article> articleList);

    ArticleDetailVO article2ArticleDetailVO(Article article);

    List<ArticleRecommendVO> articleList2ArticleRecommendList(List<Article> articleList);

    List<ArticleTimelineVO> articleList2ArticleTimelineList(List<Article> articleList);

}
